package com.feng.online_xdclass.utils;

public class JsonDate {
    //状态码，0表示成功 ，-1表示失败
    private Integer code;
    //业务数据
    private Object data;
    //信息表示
    private String msg;
    public JsonDate(){

    }
    public JsonDate(Integer code,Object data,String msg){
        this.code=code;
        this.data=data;
        this.msg=msg;
    }
    public static JsonDate bulidSuccess(){
        return new JsonDate(0,null,null);
    }
    public static JsonDate bulidSuccess(Object data){
        return new JsonDate(0,data,null);
    }
    public static JsonDate buildError(String msg){
        return new JsonDate(-1,null,msg);
    }
    public static JsonDate buildError(Integer code,String msg){
        return new JsonDate(code,null,msg);
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
